package com.gexiaobao.pigeon.ui.organizer

import android.os.Bundle
import androidx.activity.OnBackPressedCallback
import com.gexiaobao.pigeon.app.base.BaseActivity
import com.gexiaobao.pigeon.app.util.RxToast
import com.gexiaobao.pigeon.databinding.ActivityMemberInfoBinding
import com.gexiaobao.pigeon.viewmodel.MemberInfoViewModel

/**
 * @Author      : hxw
 * @Date        : 2023/6/1 11:47
 * @Describe    : 组织方-下的会员列表
 */
class ActivityMemberInfo: BaseActivity<MemberInfoViewModel, ActivityMemberInfoBinding>() {

    var exitTime = 0L

    override fun initView(savedInstanceState: Bundle?) {
        onBackPressedDispatcher.addCallback(this, object : OnBackPressedCallback(true) {
            override fun handleOnBackPressed() {
                if (System.currentTimeMillis() - exitTime > 2000) {
                    RxToast.showToast("再按一次退出程序")
                    exitTime = System.currentTimeMillis()
                } else {
                    finish()
                }
            }
        })
    }
}